package com.tinem.platform.module.starter;

import org.eclipse.paho.client.mqttv3.MqttClient;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.MqttMessage;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @className MqttEvent
 * @description TODO
 * @site
 * @company
 * @create 2022/1/19 12:17:59
 */
public interface MqttMessageListener {

    /**
     * 适配哪些客户端
     * @return null 所有
     */
    default String clientId(){ return null; };

    /**
     * 消息服务质量
     * @return
     */
    default int pos(){return 2;};

    /**
     * 订阅一个主题
     * @return
     */
    String topicFilter();

    void messageArrived(String clientId,String topic, MqttMessage message);
}
